﻿using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZhonTai.Admin.Core.Entities;

namespace ZhonTai.Admin.Domain.Patrol
{
    /// <summary>
    /// 任务概览
    /// </summary>
    [Table(Name = "patrol_task")]
    public class PatrolTaskEntity : EntityTenant
    {
        public string TaskName { set; get; }
        /// <summary>
        /// 任务类型
        /// </summary>
        public string TaskType { set; get; }

        /// <summary>
        /// 任务来源
        /// </summary>
        public string TaskSource { set; get; }

        /// <summary>
        /// 是否自动关闭
        /// 如自动关闭：当任务配置下的内容已经完成或已过期，否则用不关闭，可重复执行
        /// </summary>
        public bool IsAutoClosed { set; get; }
        /// <summary>
        /// 任务节点Id
        /// </summary>
        public long TaskNodeId { set; get; }


        #region 导航属性

        /// <summary>
        /// 任务配置
        /// </summary>
        [Navigate(nameof(PatrolTaskConfigEntity.TaskId))]
        public virtual ICollection<PatrolTaskConfigEntity> Configs { set; get; }


        #endregion
    }
}
